home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Plus 1995 #5 & #6
/
Amiga Plus CD - 1995 - No. 5 and 6.iso
/
pd
/
netz
/
term
/
extras
/
source
/
gtlayout-source.lha
/
LT_GetMenuItem.c
< prev
next >
Wrap
C/C++ Source or Header
|
1995-03-25
|
720b
|
38 lines
/* GadTools layout toolkit
**
** Copyright © 1993-1995 by Olaf `Olsen' Barthel
** Freely distributable.
**
** :ts=4
*/
#include "gtlayout_global.h"
#ifdef DO_MENUS
/* LT_GetMenuItem(struct Menu *Menu,ULONG ID):
*
* Obtain the menu item associated with the ID.
*/
struct MenuItem * LIBENT
LT_GetMenuItem(REG(a0) struct Menu *Menu,REG(d0) ULONG ID)
{
RootMenu *Root = (RootMenu *)((ULONG)Menu - offsetof(RootMenu,Menu));
ItemNode *Item;
// Run down the list...
for(Item = (ItemNode *)Root -> ItemList . mlh_Head ; Item -> Node . mln_Succ ; Item = (ItemNode *)Item -> Node . mln_Succ)
{
if(Item -> ID == ID)
return(&Item -> Item);
}
// Nothing found
return(NULL);
}
#endif /* DO_MENUS */